<template>
  <div class>
    <mt-header v-bind:title="msg">
      <router-link to="/images" slot="left">
        <mt-button icon="back">返回</mt-button>
      </router-link>
      <mt-button icon="more" slot="right"></mt-button>
    </mt-header>
    <ul>
          <li v-for="item in images" v-bind:key="item.id">
              <img v-lazy="item.image">
          </li>
      </ul>
  </div>
</template>

<script>
export default {
  name: "img_detail",
  data() {
    return {
      msg: "image detail",
      active: 2,
      selected: "1",
      images: []
    };
  },
  mounted: function () {
    // `this` 指向 vm 实例
    //console.log('a is: ' , this.topics)
    let that = this;
    let id = this.$route.query.id;
    this.$http({
      method: 'get',
      url: 'http://api.lb.com/api/travels/'+id,
      data: {
        name: 'wise',
        info: 'wrong'
      }
    }).then(function(response) {
      if(response.status == 200 && response.data){
        let images = response.data.data;
        that.images = images;
        console.log(22)
      }
    });
  },
  methods: {
    next() {
      console.log(this.selected);

      return true;
    }
  }
};
</script>